//电池充电里程分析-电耗里程分析
var chargingMileAnaly;
//电池运行状态-电压电流分析
var voltageAnaly;
//电池运行状态-续航里程
var enduranceMile;
//电机运行分析-车速转速图表
var spdAndEMSpdRept;
//电机运行分析-车速转矩图表
var spdAndTorqueRept;
//电机运行分析-电压电流图表
var vtgAndCrtRept;
//发动机数据分析-发动机功率图
var enginePower;
//发动机数据分析-外特性曲线图
var engineGraph;
//轮胎寿命分析-轮胎寿命预测
var tireLifeForecast;
//轮胎寿命分析-保养次数
var tireMaintainingTimes;
//轮胎寿命分析-轮胎分析图
var tireAnalyChart;



require(['highcharts','analyBatterychargingMileExtra','analyBatteryRunDataExtra','analyMotorDataExtra','analyEngineDataExtra','analyTireLifeDataExtra'],
    function (highcharts,analyBatterychargingMileExtra,analyBatteryRunDataExtra,analyMotorDataExtra,analyEngineDataExtra,analyTireLifeDataExtra) {
	
	var $dataChart=$("#dataChart");
	
	//图表初始化
	function initChart(){
		$dataChart.highcharts({title: {
			text: '正在查询中，请稍后'
		},
		credits: {
			enabled: false
		}});
	}
	
	//图表显示空数据
	function chartWithoutData(){
		$dataChart.highcharts({title: {
			text: '无数据'
		},
		credits: {
            enabled: false
		}});
	}
	
	chargingMileAnaly=function(params){
        analyBatterychargingMileExtra.chargingMileAnaly(params,initChart,chartWithoutData,$dataChart);
	}

    //电池-电压电流分析
    voltageAnaly=function(params){
        analyBatteryRunDataExtra.voltageAnaly(params,initChart,chartWithoutData,$dataChart);
    }

    //电池-续航里程分析
    enduranceMile=function(params){
        analyBatteryRunDataExtra.enduranceMile(params,initChart,chartWithoutData,$dataChart);
    }

    //电机运行分析-车速转速图表
    spdAndEMSpdRept=function(params){
        analyMotorDataExtra.spdAndEMSpdRept(params,initChart,chartWithoutData,$dataChart);
    }

    //电机-车速转矩分析
    spdAndTorqueRept=function(params){
        analyMotorDataExtra.spdAndTorqueRept(params,initChart,chartWithoutData,$dataChart);
    }

    //电机-电压电流分析
    vtgAndCrtRept=function(params){
        analyMotorDataExtra.vtgAndCrtRept(params,initChart,chartWithoutData,$dataChart);
    }

    //发动机数据分析-发动机功率图
    enginePower=function(params) {
        analyEngineDataExtra.enginePower(params,initChart,chartWithoutData,$dataChart);
    }

    engineGraph=function(params){
        analyEngineDataExtra.engineGraph(params,initChart,chartWithoutData,$dataChart);
    }

    //轮胎寿命分析-轮胎寿命预测
    tireLifeForecast=function(){
        analyTireLifeDataExtra.tireLifeForecast($dataChart);
    }

    //轮胎寿命分析-保养次数
    tireMaintainingTimes=function(){
        analyTireLifeDataExtra.tireMaintainingTimes($dataChart);
    }

    //轮胎寿命分析-轮胎分析图
    tireAnalyChart=function(){
        analyTireLifeDataExtra.tireAnalyChart($dataChart);
    }
	
});